package com.xsb.aspectj;

import android.content.Intent;
import android.util.Log;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.xsb.aspectj.annotation.ClickBehavior;
import com.xsb.aspectj.annotation.LoginCheck;

public class MainActivity extends AppCompatActivity {
  private final static String TAG = "MainActivity";
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
  }

  //登录
  @ClickBehavior("登录")
  public void login(View view) {
    Log.e(TAG, "模拟接口请求----验证通过 ，登录成功");
  }

  //行为统计
  @ClickBehavior("我的积分")
  @LoginCheck
  public void jifen(View view) {
    Log.e(TAG, "开始跳转到 -> 我的积分 Activity");
    startActivity(new Intent(this,BusinessActivity.class));
  }

  //行为统计
  @ClickBehavior("优惠券")
  @LoginCheck
  public void youhui(View view) {
    Log.e(TAG, "开始跳转到 -> 优惠券 Activity");
    startActivity(new Intent(this,BusinessActivity.class));
  }
  
  //行为统计
  @ClickBehavior("我的专区")
  @LoginCheck
  public void zhuanqu(View view) {
    Log.e(TAG, "开始跳转到 -> 我的专区 Activity");
    startActivity(new Intent(this,BusinessActivity.class));
  }
}
